Repository navigation
feat(server): add M0 inbound admission cap and runtime decision log (CLO-1368) - #264
nullStack65 wants to merge 3 commits into
Conversation
…CLO-1368) Implement M0 Items 2 and 3 from the Bot Runtime Plan (CLO-1368): - Add pure Inbound Cap v0 in packages/shared/src/inboundAdmission.ts: status and routine PR events never wake a thread; authenticated system pr_actionable wakes only on a PR opened/linked by a founder-mission thread or covered by a seat's active watch; remaining events on founder-mission threads accept only founders and own children, and seats accept founders, their reportsTo chain, and own children; all other deliveries cap at digest. - Wire inbound admission into Orchestrator.dispatchMessage (fail-safe to digest on error) and surface the effective deliveryClass and deliveryReason back to senders via ThreadManagementService and t3_thread_send. - Add migration 125_RuntimeDecisions.ts and append-only RuntimeDecisionStore (with SQLite CHECK constraints, update/delete abort triggers, and fail-closed audience filtering before write) supporting both inbound and placement decision records. - Add runtimeEnforcement server setting defaulting to observe (logs decisions with enforced=0 without capping) with a clean switch to enforce or off. - Add conformance unit tests for M0 exact checks 1 and 2 across shared, persistence, orchestrator, and MCP layers. Refs: CLO-1368 Model: gemini-4-neon Task: implementation Agent: Builder Harness: t3/antigravity Model-family: Gemini Model-generation: 4 Neon Skills-SHA: nullStack65/closura-agent-config@da5f664; skills/github-repository-ops/SKILL.md (sha256:e3778c3a953bfa9e7bf5c9b9609b6d6c947cffa03366b3bc0f75bbb722b76784, installed matches source)
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
Clean-room full review #1 of 2 (Tier 3) for PR #264 against Bot Runtime Plan ( SummaryThe core architecture (pure
{
"reviewed_base": "6382e077dede0c225c1cac0c7b2c4ec14e0a04a8",
"reviewed_head": "965fd14be6b38b5eee630740eec4a09a8819b7d5",
"reviewer": "gemini-4-neon, t3/antigravity",
"author_session": "mcp:launch:7aeae44da2405bd57e60ae88cb8c8a34d10c920bd7a031ab1fced22102bdd079",
"reviewer_session": "2318a245-a08e-487f-86ce-8dded636e0cf",
"fresh_context": true,
"review_kind": "full",
"round_id": "2318a245-a08e-487f-86ce-8dded636e0cf",
"intent": [
"CLO-1368 M0-2/3: implement Inbound Cap v0 in packages/shared/src/inboundAdmission.ts and append-only runtime_decisions log in observe mode"
],
"prior_findings": [],
"findings": [
{
"id": "F1",
"severity": "important",
"summary": "ACTIONABLE_PR_SUMMARY_RE uses singular \\bcomment\\b and 'awaiting approval', missing PullRequestWatchReactor's actual summaries '#<n>: new comments' (used for all review remarks including changes requested, with outcome 'updated') and '#<n>: checks await approval' (outcome 'updated'). In enforce mode, covered PR review-comment and checks-awaiting-approval wakes are misclassified as pr_routine and dropped as log_only.",
"outcome": "open",
"file": "apps/server/src/orchestration-v2/InboundAdmission.ts",
"line": 88,
"check": "node -e 're.test(\"#481: new comments\") -> false; re.test(\"#481: checks await approval\") -> false' (compared against SUMMARY in apps/server/src/orchestration-v2/pullRequestWatch.ts:513-523)"
},
{
"id": "F2",
"severity": "important",
"summary": "DEFAULT_SEAT_REPORTS_TO omits gardening: 'cto' (present in config/standing-threads.json; Gardening is one of the first three enforcement roles in plan section 7.5). CTO/CEO sends to Gardening return false from isInReportsToChain, are misclassified as peer status, and are capped at digest in enforce mode.",
"outcome": "open",
"file": "packages/shared/src/inboundAdmission.ts",
"line": 81,
"check": "Compared DEFAULT_SEAT_REPORTS_TO against origin/master:config/standing-threads.json roles (gardening reportsTo cto is missing)"
},
{
"id": "F3",
"severity": "important",
"summary": "applyInboundAdmissionToCommand does not downgrade dispatchMode from restart_active to steer_active when admitInbound caps interrupt down to steer_at_tool_boundary (e.g., chain/child/delegator interrupt send), so CommandPolicy.resolveMessageDispatch still restarts the active turn.",
"outcome": "open",
"file": "apps/server/src/orchestration-v2/InboundAdmission.ts",
"line": 372,
"check": "Inspected applyInboundAdmissionToCommand (lines 354-379) and CommandPolicy.resolveMessageDispatch (lines 105-136)"
},
{
"id": "F4",
"severity": "nit",
"summary": "In observe mode (enforced === false), t3_thread_send still returns inboundAdmission.reason as deliveryReason even when capped === true, pairing an uncapped deliveryClass (e.g. next_turn) with a reason saying it was capped at digest.",
"outcome": "open",
"file": "apps/server/src/mcp/OrchestratorMcpService.ts",
"line": 4084,
"check": "Inspected OrchestratorMcpService.ts lines 4078-4095"
}
]
} |
…368) Address clean-room review findings F1-F4 on the M0 inbound admission cap: - F1: match pullRequestWatch 'new comments' and 'checks await approval' summaries as pr_actionable. - F2: add 'gardening: cto' to DEFAULT_SEAT_REPORTS_TO. - F3: downgrade restart_active to steer_active when applyInboundAdmissionToCommand caps interrupt to steer_at_tool_boundary. - F4: omit capped deliveryReason in t3_thread_send when runtimeEnforcement is observe (enforced=false) so it does not contradict the uncapped deliveryClass. Model: gemini-4-neon Task: fix Agent: Builder Harness: t3/antigravity Model-family: Gemini Model-generation: 4 Neon Skills-SHA: nullStack65/closura-agent-config@da5f664; skills/github-repository-ops/SKILL.md (sha256:e3778c3a953bfa9e7bf5c9b9609b6d6c947cffa03366b3bc0f75bbb722b76784, installed matches source) Refs: CLO-1368
|
Clean-room full review #2 of 2 (Tier 3 quorum) at head What I read: the full diff (20 files), What I ran (disposable worktree at the head,
Findings
Exact checks: exact check 1 (Factory sequence 0 turns, covered vs uncovered/routine watch, chain wakes an idle seat) and exact check 2 (query returns 0) both pass as fixtures. Observe is the default, so nothing is capped until enforce. {
"reviewed_base": "6382e077dede0c225c1cac0c7b2c4ec14e0a04a8",
"reviewed_head": "ca33e76bc9408250fbb6f62730212634a88d4370",
"reviewer": "claude-opus-5-5 (t3/antigravity)",
"author_session": "mcp:launch:7aeae44da2405bd57e60ae88cb8c8a34d10c920bd7a031ab1fced22102bdd079",
"reviewer_session": "antigravity:bc4026d5-1a03-4fc4-8f18-6039088cb30c",
"fresh_context": true,
"review_kind": "full",
"round_id": "antigravity:bc4026d5-1a03-4fc4-8f18-6039088cb30c",
"intent": ["CLO-1368 M0-2/3: implement Inbound Cap v0 in packages/shared/src/inboundAdmission.ts and append-only runtime_decisions log in observe mode"],
"prior_findings": [],
"findings": [
{
"id": "F1",
"severity": "important",
"outcome": "open",
"file": "apps/server/src/orchestration-v2/InboundAdmission.ts",
"line": 227,
"summary": "The thread's own provider wakes are treated as inbound system events. A monitor notification without a PR stamp (Claude Monitor wake) becomes pr_routine/log_only and is dropped under enforce. background_task/system sources (ScheduleWakeup, mixed background reports, ProviderContinuationService default, PeerLinkRequests outcomes) fall to alert and are capped at digest for every recipient. isInternalDispatchCommand exempts none of them. Reproduced at head: Monitor wake gave log_only with 0 runs; background-task wake gave digest with 0 started runs."
},
{
"id": "F2",
"severity": "important",
"outcome": "open",
"file": "apps/server/src/persistence/Migrations.ts",
"line": 273,
"summary": "Fork migration RuntimeDecisions takes ledger id 125. Under the documented +6 offset (line 145: every later upstream migration registers at id+6), that id belongs to upstream 119_WorkflowRunSubject, which already exists on upstream main. Deployed fleet DBs will record 125=RuntimeDecisions, and a sync that follows the documented rule fails assertV2MigrationsCanRun (BadState) at startup. Update the offset doc and upstream-sync doc for the new mapping, and assert manifest ids are unique."
},
{
"id": "F3",
"severity": "nit",
"outcome": "open",
"file": "apps/server/src/orchestration-v2/InboundAdmission.ts",
"line": 141,
"summary": "Founder-mission PR coverage accepts any linked PR, including agent/stack links another bot can add. The spec says PR opened by the founder thread, which the created link source and branch PR match more closely."
},
{
"id": "F4",
"severity": "nit",
"outcome": "open",
"file": "apps/server/src/orchestration-v2/InboundAdmission.test.ts",
"line": 474,
"summary": "The exact-check-2 query matches 'steer', but the log stores steer_at_tool_boundary/interrupt, so the query as written cannot detect a steer-class leak."
},
{
"id": "F5",
"severity": "nit",
"outcome": "open",
"file": "packages/contracts/src/orchestrationV2.ts",
"line": 4132,
"summary": "The new inboundEventKind wire field on message.dispatch has no producer; it adds unused contract surface."
},
{
"id": "F6",
"severity": "nit",
"outcome": "open",
"file": "apps/server/src/orchestration-v2/InboundAdmission.ts",
"line": 95,
"summary": "Under enforce, checks-passed events are pr_routine/log_only (dropped, not digested), while the watch_pull_request docs still promise a wake on passed required checks. until=merged watchers lose their trigger. This follows the plan's table, but the docs and enforce rollout need a note."
},
{
"id": "F7",
"severity": "nit",
"outcome": "open",
"file": "packages/shared/src/inboundAdmission.ts",
"line": 263,
"summary": "A founder-created scheduled task bound to a founder-mission thread is capped at digest and never starts under enforce. This follows the M0 text literally; confirm it is intended before switching to enforce."
}
]
} |
…ork migration ledger (CLO-1368) Address clean-room review 2/2 (Opus) findings on PR #264: - Opus F1: bypass inbound admission for a thread's own provider continuations (creationSource === 'provider' or commandId starting with 'provider-continuation:'), and only classify monitor notifications with a PR stamp (pullRequest / otherPullRequests) or 'message:pr-watch:' prefix as pr_actionable/pr_routine so background_task and non-PR monitor wakes pass through as child/child_result under enforce. - Opus F2: move RuntimeDecisions out of effect_sql_migrations (avoiding collision with upstream 119_WorkflowRunSubject under the +6 offset) into Migrations/fork/001_RuntimeDecisions.ts tracked in a dedicated closura_sql_migrations table without advancing effect_sql_migrations MAX(migration_id) or writing under PRAGMA query_only = ON. Model: gemini-4-neon Task: fix Agent: Builder Harness: t3/antigravity Model-family: Gemini Model-generation: 4 Neon Skills-SHA: nullStack65/closura-agent-config@da5f664; skills/github-repository-ops/SKILL.md (sha256:e3778c3a953bfa9e7bf5c9b9609b6d6c947cffa03366b3bc0f75bbb722b76784, installed matches source) Refs: CLO-1368
|
Focused re-check of F1 and F2 for PR #264 at head F1 (important): confirmed fixed. In
F2 (important): confirmed fixed. {
"reviewed_base": "6382e077dede0c225c1cac0c7b2c4ec14e0a04a8",
"reviewed_head": "18436729ac06d036b738faaa8afe5a2ac71a7f1f",
"reviewer": "claude-sonnet-5-5 (t3/antigravity)",
"author_session": "mcp:launch:7aeae44da2405bd57e60ae88cb8c8a34d10c920bd7a031ab1fced22102bdd079",
"reviewer_session": "antigravity:019b7c45-80e8-4f92-82d0-38de1649a043",
"fresh_context": true,
"review_kind": "focused_recheck",
"round_id": "antigravity:bc4026d5-1a03-4fc4-8f18-6039088cb30c",
"intent": ["CLO-1368 M0-2/3: implement Inbound Cap v0 in packages/shared/src/inboundAdmission.ts and append-only runtime_decisions log in observe mode"],
"prior_findings": ["F1", "F2"],
"findings": [
{
"id": "F1",
"severity": "important",
"outcome": "confirmed",
"rechecked_head": "18436729ac06d036b738faaa8afe5a2ac71a7f1f",
"file": "apps/server/src/orchestration-v2/InboundAdmission.ts",
"line": 233,
"summary": "The thread's own provider wakes are treated as inbound system events. A monitor notification without a PR stamp (Claude Monitor wake) becomes pr_routine/log_only and is dropped under enforce. background_task/system sources (ScheduleWakeup, mixed background reports, ProviderContinuationService default, PeerLinkRequests outcomes) fall to alert and are capped at digest for every recipient. isInternalDispatchCommand exempts none of them. Reproduced at head: Monitor wake gave log_only with 0 runs; background-task wake gave digest with 0 started runs. Re-check at 1843672: provider-source and provider-continuation commands are now internal; background_task and non-PR monitor notifications classify as child_result; new tests cover each."
},
{
"id": "F2",
"severity": "important",
"outcome": "confirmed",
"rechecked_head": "18436729ac06d036b738faaa8afe5a2ac71a7f1f",
"file": "apps/server/src/persistence/Migrations.ts",
"line": 278,
"summary": "Fork migration RuntimeDecisions takes ledger id 125. Under the documented +6 offset (line 145: every later upstream migration registers at id+6), that id belongs to upstream 119_WorkflowRunSubject, which already exists on upstream main. Deployed fleet DBs will record 125=RuntimeDecisions, and a sync that follows the documented rule fails assertV2MigrationsCanRun (BadState) at startup. Update the offset doc and upstream-sync doc for the new mapping, and assert manifest ids are unique. Re-check at 1843672: RuntimeDecisions moved to a separate closura_sql_migrations ledger (fork/001), so upstream ids no longer collide; migration tests assert the fork manifest."
},
{
"id": "F3",
"severity": "nit",
"outcome": "open",
"file": "apps/server/src/orchestration-v2/InboundAdmission.ts",
"line": 141,
"summary": "Founder-mission PR coverage accepts any linked PR, including agent/stack links another bot can add. The spec says PR opened by the founder thread, which the created link source and branch PR match more closely."
},
{
"id": "F4",
"severity": "nit",
"outcome": "open",
"file": "apps/server/src/orchestration-v2/InboundAdmission.test.ts",
"line": 474,
"summary": "The exact-check-2 query matches 'steer', but the log stores steer_at_tool_boundary/interrupt, so the query as written cannot detect a steer-class leak."
},
{
"id": "F5",
"severity": "nit",
"outcome": "open",
"file": "packages/contracts/src/orchestrationV2.ts",
"line": 4132,
"summary": "The new inboundEventKind wire field on message.dispatch has no producer; it adds unused contract surface."
},
{
"id": "F6",
"severity": "nit",
"outcome": "open",
"file": "apps/server/src/orchestration-v2/InboundAdmission.ts",
"line": 95,
"summary": "Under enforce, checks-passed events are pr_routine/log_only (dropped, not digested), while the watch_pull_request docs still promise a wake on passed required checks. until=merged watchers lose their trigger. This follows the plan's table, but the docs and enforce rollout need a note."
},
{
"id": "F7",
"severity": "nit",
"outcome": "open",
"file": "packages/shared/src/inboundAdmission.ts",
"line": 263,
"summary": "A founder-created scheduled task bound to a founder-mission thread is capped at digest and never starts under enforce. This follows the M0 text literally; confirm it is intended before switching to enforce."
}
]
} |
|
Note 🤖 Grok 4.7 responding on behalf of nullStack65 Focused re-check of Neon round F1. F2. The patch adds F3. When a cap delivers F4. In observe mode with Tests run at this head, with dependencies linked from an existing checkout: {
"reviewed_base": "6382e077dede0c225c1cac0c7b2c4ec14e0a04a8",
"reviewed_head": "18436729ac06d036b738faaa8afe5a2ac71a7f1f",
"reviewer": "grok-4.7 (t3/grok-direct)",
"author_session": "mcp:launch:7aeae44da2405bd57e60ae88cb8c8a34d10c920bd7a031ab1fced22102bdd079",
"reviewer_session": "grok-direct:01a2402e-2a09-7fe2-ac24-d3b00f223111",
"fresh_context": true,
"review_kind": "focused_recheck",
"round_id": "2318a245-a08e-487f-86ce-8dded636e0cf",
"intent": [
"CLO-1368 M0-2/3: implement Inbound Cap v0 in packages/shared/src/inboundAdmission.ts and append-only runtime_decisions log in observe mode"
],
"prior_findings": ["F1", "F2", "F3", "F4"],
"findings": [
{
"id": "F1",
"severity": "important",
"outcome": "confirmed",
"rechecked_head": "18436729ac06d036b738faaa8afe5a2ac71a7f1f",
"file": "apps/server/src/orchestration-v2/InboundAdmission.ts",
"line": 90,
"summary": "ACTIONABLE_PR_SUMMARY_RE now matches pullRequestWatch summaries '#<n>: new comments' and '#<n>: checks await approval' (comments? and await(?:ing)? approval). Enforce-mode dispatch of those updated outcomes is pr_actionable and wakes the covered seat.",
"check": "node regex samples matched both producer strings and rejected '#482: checks passed'; vp test run apps/server InboundAdmission.test.ts -t 'new comments' passed at 18436729ac06d036b738faaa8afe5a2ac71a7f1f"
},
{
"id": "F2",
"severity": "important",
"outcome": "open",
"file": "packages/shared/src/inboundAdmission.ts",
"line": 94,
"summary": "The repair adds gardening: cto, so CTO and CEO are in Gardening's reportsTo chain. config/standing-threads.json at plan pin 5769633bd95e and closura-agent-config 943f200f69 has no reportsTo on the gardening role. The original registry claim is not true, and the new edge is not confirmed.",
"check": "python compare of standing-threads roles: gardening reportsTo is absent at 5769633bd95e and 943f200f69; Platform and ARC Ops report to cto. Shared inboundAdmission.test.ts asserts the new edge and passed, which shows the code disagrees with the registry."
},
{
"id": "F3",
"severity": "important",
"outcome": "confirmed",
"rechecked_head": "18436729ac06d036b738faaa8afe5a2ac71a7f1f",
"file": "apps/server/src/orchestration-v2/InboundAdmission.ts",
"line": 386,
"summary": "A cap to steer_at_tool_boundary rewrites dispatchMode from restart_active to steer_active and drops deliveryIntent. Orchestrator then requests steer, and resolveDeliveryIntent returns steer_active instead of restarting the active turn.",
"check": "Read applyInboundAdmissionToCommand, Orchestrator.ts delivery-class intent, and CommandPolicy.resolveDeliveryIntent. vp test run -t steer_active passed the downgrade assertion at 18436729ac06d036b738faaa8afe5a2ac71a7f1f"
},
{
"id": "F4",
"severity": "nit",
"outcome": "fixed",
"file": "apps/server/src/mcp/OrchestratorMcpService.ts",
"line": 4084,
"summary": "In observe mode with capped true, t3_thread_send omits deliveryReason, so an uncapped deliveryClass is not paired with a cap reason. Enforced caps still return the reason.",
"check": "vp test run OrchestratorMcpService.activity.test.ts -t deliveryReason passed: observe capped reason undefined, observe uncapped reason kept, enforce capped reason returned"
}
]
} |
RESULTNote 🤖 Grok 4.7 responding on behalf of nullStack65 Focused re-check of F2 only, Neon round F2. That edge matches the current registry. closura-agent-config {
"reviewed_base": "6382e077dede0c225c1cac0c7b2c4ec14e0a04a8",
"reviewed_head": "18436729ac06d036b738faaa8afe5a2ac71a7f1f",
"reviewer": "grok-4.7 (t3/grok-direct)",
"author_session": "mcp:launch:7aeae44da2405bd57e60ae88cb8c8a34d10c920bd7a031ab1fced22102bdd079",
"reviewer_session": "grok-direct:01a2403f-7e3c-7d62-bc48-e92cecc03acc",
"fresh_context": true,
"review_kind": "focused_recheck",
"round_id": "2318a245-a08e-487f-86ce-8dded636e0cf",
"intent": [
"CLO-1368 M0-2/3: implement Inbound Cap v0 in packages/shared/src/inboundAdmission.ts and append-only runtime_decisions log in observe mode"
],
"prior_findings": [
"F2"
],
"findings": [
{
"id": "F1",
"severity": "important",
"outcome": "confirmed",
"rechecked_head": "18436729ac06d036b738faaa8afe5a2ac71a7f1f",
"file": "apps/server/src/orchestration-v2/InboundAdmission.ts",
"line": 90,
"summary": "ACTIONABLE_PR_SUMMARY_RE now matches pullRequestWatch summaries '#<n>: new comments' and '#<n>: checks await approval' (comments? and await(?:ing)? approval). Enforce-mode dispatch of those updated outcomes is pr_actionable and wakes the covered seat.",
"check": "node regex samples matched both producer strings and rejected '#482: checks passed'; vp test run apps/server InboundAdmission.test.ts -t 'new comments' passed at 18436729ac06d036b738faaa8afe5a2ac71a7f1f"
},
{
"id": "F2",
"severity": "important",
"outcome": "confirmed",
"file": "packages/shared/src/inboundAdmission.ts",
"line": 94,
"summary": "The repair's gardening: cto edge matches the current registry. closura-agent-config origin/master 9f9807a5 (3777a9c018, CLO-1001) sets roles[] gardening reportsTo to cto. docs/org-chain-of-command.md line 12 lists Gardening directly under CTO. Head 18436729 sets DEFAULT_SEAT_REPORTS_TO gardening to cto at packages/shared/src/inboundAdmission.ts:94, and inboundAdmission.test.ts asserts isInReportsToChain(CTO and CEO, Gardening) true and the reverse false.",
"check": "git show origin/master:config/standing-threads.json at 9f9807a5a3928ad23f6869b78081699f8d42b9b1: roles[] role gardening reportsTo is cto (not an org.seats entry). org-chain-of-command.md line 12 is Gardening under CTO. git show 18436729ac06d036b738faaa8afe5a2ac71a7f1f:packages/shared/src/inboundAdmission.ts line 94 is gardening: cto; inboundAdmission.test.ts lines 278-279 and 287 assert the chain. The worktree at 943f200f69 is 92 commits behind origin/master and still omits reportsTo; the confirmed source is origin/master.",
"rechecked_head": "18436729ac06d036b738faaa8afe5a2ac71a7f1f"
},
{
"id": "F3",
"severity": "important",
"outcome": "confirmed",
"rechecked_head": "18436729ac06d036b738faaa8afe5a2ac71a7f1f",
"file": "apps/server/src/orchestration-v2/InboundAdmission.ts",
"line": 386,
"summary": "A cap to steer_at_tool_boundary rewrites dispatchMode from restart_active to steer_active and drops deliveryIntent. Orchestrator then requests steer, and resolveDeliveryIntent returns steer_active instead of restarting the active turn.",
"check": "Read applyInboundAdmissionToCommand, Orchestrator.ts delivery-class intent, and CommandPolicy.resolveDeliveryIntent. vp test run -t steer_active passed the downgrade assertion at 18436729ac06d036b738faaa8afe5a2ac71a7f1f"
},
{
"id": "F4",
"severity": "nit",
"outcome": "fixed",
"file": "apps/server/src/mcp/OrchestratorMcpService.ts",
"line": 4084,
"summary": "In observe mode with capped true, t3_thread_send omits deliveryReason, so an uncapped deliveryClass is not paired with a cap reason. Enforced caps still return the reason.",
"check": "vp test run OrchestratorMcpService.activity.test.ts -t deliveryReason passed: observe capped reason undefined, observe uncapped reason kept, enforce capped reason returned"
}
]
} |
|
Superseded by nullStack65/t3code-private#65 (https://github.com/nullStack65/t3code-private/pull/65). Custom T3 work belongs in the private fork: this repo's push guard blocks pushes of it, and the fork rule (rule 19) says a T3 change ships as the fork's default. The branch is rebased onto the private fork's release/native-0.1.10 at head d3ee0775f31364184bc55ab4200aed5e4541579a. Closing this pull request as superseded; the founder sign-off stays unraised until the private pull request is mergeable. Model: grok-4.7 |
Deploy: fleet
Problem
Any sender can currently name a waking delivery class (
next_turn,when_idle,steer_at_tool_boundary, orinterrupt) and start a turn on another thread, including founder-mission working threads and standing seats. Status updates and routine/uncovered PR events therefore woke threads without recipient-side admission control, and there was no append-only runtime decision log to measure observe-mode vs enforce-mode routing (Bot Runtime Plan CLO-1368, M0 Items 2 and 3).Attribution: Implemented by Builder (
gemini-4-neon,t3/antigravity) againstdocs/architecture/bot-runtime-plan-20261201.mdsections 7 and 11 (CLO-1368). Human review state: pending.Changes
packages/shared/src/inboundAdmission.ts,apps/server/src/orchestration-v2/InboundAdmission.ts):statusandpr_routineevents never wake a thread (digestandlog_onlyrespectively).pr_actionableevents evaluate before generic seat/founder-mission sender caps and wake only when the PR is linked/opened on the founder-mission thread or covered by the seat's active watch; uncovered or unauthenticated system PR events yieldlog_only(0 turns).reportsTochain, and own children.digest, andt3_thread_sendreturns both the effectivedeliveryClassanddeliveryReasonto the sender.Orchestrator.dispatchMessage(with Section 8.5 fail-safe fallback todigeston error), avoiding overlap with open PRs fix(server): route lane-ended events once per condition and detach settled launchers (CLO-1302) #238 and feat(orchestration): standing manager mailbox batches queued work founder-first #239.runtime_decisionsdecision log (apps/server/src/persistence/Migrations/125_RuntimeDecisions.ts,apps/server/src/persistence/RuntimeDecisions.ts):runtime_decisions(at, env, thread, kind, event_kind, recipient_founder_mission, input_digest, decision, reason, enforced)with SQLiteCHECKconstraints (kind IN ('inbound', 'placement'), inbound-only fields null forplacement) andBEFORE UPDATE/BEFORE DELETEabort triggers.runtimeEnforcement: "off" | "observe" | "enforce"fork setting inServerSettings, defaulting to"observe"(enforced = 0, shadow-only) with a clean switch to"enforce"(enforced = 1).reportsTochain send to idle seat yields a turn while peer send caps atdigest.runtime_decisionsreturning0.t3_thread_sendsender return verified for cappeddeliveryClassanddeliveryReason.Verification
Verified on head
965fd14be6b38b5eee630740eec4a09a8819b7d5(rebased ontoorigin/release/native-0.1.106382e077de):vp fmt --check(20 changed files): pass (0 issues)vp lint(19 changed TS files, 206 rules): pass (0 warnings, 0 errors)vp run knip:check: 0 unused files/exports in changed files (pre-existing fork baseline findings unchanged)vp run typecheck:packages/contractsOK,packages/sharedOK,apps/serverOK (0 errors)packages/shared:vp test run src/inboundAdmission.test.ts— 13/13 passedapps/server:vp test run src/persistence/RuntimeDecisions.test.ts src/persistence/Migrations.test.ts src/orchestration-v2/InboundAdmission.test.ts src/mcp/OrchestratorMcpService.activity.test.ts src/provider/AgentContextBudget.test.ts— 5 files, 39/39 passedNot run locally:
apps/webtypecheck (unrelated pre-existing errors inSidebar.logic.test.tsandbotOrgTree.test.tson base) and CI full suite.Model: gemini-4-neon
Task: implementation
Agent: Builder
Harness: t3/antigravity
Model-family: Gemini
Model-generation: 4 Neon
Skills-SHA: nullStack65/closura-agent-config@da5f66450f9d69207369395f7a30686834767453; skills/github-repository-ops/SKILL.md (sha256:e3778c3a953bfa9e7bf5c9b9609b6d6c947cffa03366b3bc0f75bbb722b76784, installed matches source)
Refs: CLO-1368